package com.whoimi.admin.model;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;

/**
 * 下拉选项对象
 */
public class Option<T> {

    public Option(T value, String label) {
        this.value = value;
        this.label = label;
    }

    public Option(T value, String label, List<Option<T>> children) {
        this.value = value;
        this.label = label;
        this.children = children;
    }

    public Option(T value, String label, String tag) {
        this.value = value;
        this.label = label;
        this.tag = tag;
    }


    private T value;

    private String label;

    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private String tag;

    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private List<Option<T>> children;

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public List<Option<T>> getChildren() {
        return children;
    }

    public void setChildren(List<Option<T>> children) {
        this.children = children;
    }
}